package easymall.clients;

import easymall.po.Cart;
import easymall.pojo.MyCart;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient("cartservice")
public interface CartService {
    @PostMapping("/findCart")
    Cart findCart(@RequestBody Cart cart);

    @PostMapping("/addCart")
    int addCart(@RequestBody Cart cart);

    @PostMapping("/updateCart")
    int updateCart(@RequestBody Cart cart);

    @GetMapping("/showCart")
    List<MyCart> showCart(@RequestParam int user_id);

    @PostMapping("/updateBuyNum")
    void updateBuyNum(@RequestBody Cart cart);

    @GetMapping("/delCart")
    void delCart(@RequestParam Integer cartID);

    @GetMapping("/findByCartID")
    MyCart findByCartID(@RequestParam  Integer cartID);
}
